var express = require('express');
var router = express.Router();
const {add ,find ,update,dle,getlist} = require("../service/goodsService")

 // 商品新增
router.post('/add', async function (req, res, next) {
    // console.log(req.body);
    
   let data = await add(req.body);
   res.send(data);
});
router.post('/getlist', async function (req, res, next) {
    // console.log(req.body);
    
   let data = await getlist(req.body);
   console.log(data);

   res.send(data);
});

router.post("/dle",async function(req,res,next){
    // console.log(req.body);
    
   let data = await dle(req.body);
   res.send(data);
});
router.post('/update', async function (req, res, next) {
    // console.log(req.body);
    
   let data = await update(req.body);
   res.send(data);
});

//       查询
// router.post("/find",async function(req,res , next){
//    let data = await find(req.body);
//    res.send(data);
// });

//       删除
// router.post("/remove",async function(req,res,next){
//    let data = await remove(req.body);
//    res.send(data);
// });


module.exports = router;